import request from '@/utils/request';
import { AxiosPromise } from 'axios';
import { JqtCpLinksVO, JqtCpLinksForm, JqtCpLinksQuery } from '@/api/bus/jqtCpLinks/types';

/**
 * 查询企业链接列表
 * @param query
 * @returns {*}
 */

export const listJqtCpLinks = (query?: JqtCpLinksQuery): AxiosPromise<JqtCpLinksVO[]> => {
  return request({
    url: '/bus/jqtCpLinks/list',
    method: 'get',
    params: query
  });
};

/**
 * 查询企业链接详细
 * @param id
 */
export const getJqtCpLinks = (id: string | number): AxiosPromise<JqtCpLinksVO> => {
  return request({
    url: '/bus/jqtCpLinks/' + id,
    method: 'get'
  });
};

/**
 * 新增企业链接
 * @param data
 */
export const addJqtCpLinks = (data: JqtCpLinksForm) => {
  return request({
    url: '/bus/jqtCpLinks',
    method: 'post',
    data: data
  });
};

/**
 * 修改企业链接
 * @param data
 */
export const updateJqtCpLinks = (data: JqtCpLinksForm) => {
  return request({
    url: '/bus/jqtCpLinks',
    method: 'put',
    data: data
  });
};

/**
 * 删除企业链接
 * @param id
 */
export const delJqtCpLinks = (id: string | number | Array<string | number>) => {
  return request({
    url: '/bus/jqtCpLinks/' + id,
    method: 'delete'
  });
};
